Component({
  data: {
    statusBarHeight: 0
  },
  properties: {
    // 控制返回按钮是否显示
    back: Boolean,
    // 控制返回的步数
    delta: {
      type: Number,
      value: 1
    }
  },
  options: {
    addGlobalClass: true,
    multipleSlots: true
  },
  externalClasses: ['custom-class', 'title-class'],
  lifetimes: {
    created() {
      // console.log('组件实例被创建出来后执行 created');
    },
    attached() {
      // console.log('组件实例被挂载到页面后执行 attached');
      const info = wx.getSystemInfoSync()
      // console.log(info);
      this.setData({
        statusBarHeight: info.statusBarHeight
      })
    }
  },
  methods: {
    goBack(){
      wx.navigateBack(this.data.delta)
    }
  }
})